s=input()
for i in s:
    if i=='#':
        break
    elif i>='A' and i<='Z':
        print(i.lower(),end='')
    elif i>='a' and i<='z':
        print(i.upper(),end='')
    else:
        print(i,end='')